package com.demo.webapp.jcaptcha.core.fontgenerator;

import java.awt.Font;
import java.awt.geom.AffineTransform;

import com.octo.captcha.component.image.fontgenerator.RandomFontGenerator;

public class WaveRandomFontGenerator extends RandomFontGenerator {

	public WaveRandomFontGenerator(Integer minFontSize, Integer maxFontSize) {
		super(minFontSize, maxFontSize);
	}
	
	public WaveRandomFontGenerator(Integer minFontSize, Integer maxFontSize, Font[] fontsList) {
		super(minFontSize, maxFontSize, fontsList);
	}
	
	protected Font applyCustomDeformationOnGeneratedFont(Font font) {
		AffineTransform at = new AffineTransform();
		float angle = this.myRandom.nextFloat() / 3.0F;
		at.rotate(-angle);
		//font.deriveFont(at);
		return font.deriveFont(at);
		//return super.applyCustomDeformationOnGeneratedFont(font);
	}
}
